from tkinter import *
X=int(input("Введите начальную координату X: "))
Y=int(input("Введите начальную координату Y: "))
N=int(input("Введите коофициент увилечения N: "))

cood=[0, 0, 10, 0, 10, 10, 20, 10, 20, 20, 10, 20, 10, 30, 0, 30]
if (N==0 and X>=0 and X<=500 and Y>=0 and Y<=500):
    pass
else:
    if ( N>0 and 0*N+X>=0 and 0*N+Y>=0 and 20*N+X<=500 and 20*N+Y<=500):
        pass
    else:
        if (N<0 and 20*N+X>=0 and 20*N+Y>=0 and 0*N+X<=500 and 0*N+Y<=500):
            pass
        else:
            print ("Размер фигуры превышает максимальный размер поля")
            exit()
window=tk.Tk()
window.title("IT maraphon")
window.geometry("500x500")

canvas=Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.crate_polygon(cood[0]*N+X, cood[1]*N+Y,
                     cood[2]*N+X, cood[3]*N+Y,
                     cood[4]*N+X, cood[5]*N+Y,
                     cood[6]*N+X, cood[7]*N+Y,
                     cood[8]*N+X, cood[9]*N+Y,
                     cood[10]*N+X, cood[11]*N+Y,
                     cood[12]*N+X, cood[13]*N+Y,
                     cood[14]*N+X, cood[15]*N+Y)


           
window.mainloop()
